<template>
  <div class="home-categories">
    <div class="list">
      <template v-for="(item, key) in categories" :key="key">
        <div class="item">
          <img :src="item.subPictureUrl"/>
          <span>{{ item.title }}</span>
        </div>
      </template>
    </div>
  </div>
</template>

<script setup>
import useHomeStore from '@/stores/modules/home';
import { storeToRefs } from 'pinia'

const homeStore = useHomeStore();
const { categories } = storeToRefs(homeStore)


</script>

<style lang="less" scoped>
.home-categories {
  width: 100%;
  .list {
    display: flex;
    overflow-x: auto;

    height: 80px;
    padding: 0 10px;
    margin-top: 8px;
    &::-webkit-scrollbar {
      display: none;
    }
    
    .item {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      width: 70px;
      text-align: center;

      img {
        width: 32px;
        height: 32px;
      }

      .text {
        font-size: 12px;
        margin-top: 8px;
      }
    }
  }
}
</style>